package com.common.util;

import java.util.List;

public class DataUtils {
    public static boolean isListEqual(List list1, List list2){

        if (list1 == list2){
            return true;
        }

        if (list1 == null && list2 == null){
            return true;
        }

        if (list1 == null || list2 == null){
            return false;
        }

        if (list1.size() != list2.size()){
            return false;
        }

        for (Object o : list1) {
            if (!list2.contains(o)){
                return false;
            }
        }

        for (Object o : list2) {
            if (!list1.contains(o)){
                return false;
            }
        }

        return true;
    }

}
